<%--
  ** Copyright(c) 2005 BroadVision, Inc. All rights reserved.
  **
  ** This software is copyrighted.  Under the copyright laws, this software
  ** may not be copied, in whole or in part, without prior written consent
  ** of BroadVision, Inc. or its assignees. This software is provided under
  ** the terms of a license between BroadVision and the recipient, and its
  ** use is subject to the terms of that license.
  **
  ** This software may be protected by one or more U.S. and International
  ** patents. Certain applications of BroadVision One-To-One software are
  ** covered by U.S. patent 5,710,887.
  **
  ** TRADEMARKS: BroadVision and the BroadVision logo are registered
  ** trademarks, and BroadVision One-To-One is a trademark of BroadVision,
  ** Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,
  ** MD5, and RC2 are trademarks of RSA Data Security, Inc. All other
  ** trademarks, service marks, and trade names belong to their respective
  ** owners. BroadVision, Inc. disclaims any proprietary interest in the
  ** marks and names of others.
  --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>

<html-el:javascript formName="reportResourceForm"/>

<script language="Javascript">
  function doCancel(form)
  {
    var url = '<html-el:rewrite page="/bp/runtimeReportConfigResource.do"/>';
    form.action = url;
    form.submit();
    return true;
  }

  function doUpdate(form)
  {
    if (!validateReportResourceForm(form))
      return false;
    form.submit();
    return true;
  }
</script>

<c:set
  var="subtitleKey"
  value="bp.report.jdbcResourceEdit.subtitle.${reportResourceForm.map.type}"
/>

<html-el:form action="/bp/reportResourceUpdate.do"
              onsubmit="return doUpdate(this);">
<html-el:hidden name ="reportResourceForm" property="type"/>
<html-el:hidden name ="reportResourceForm" property="name"/>

<table class="zoneFive" summary="resource config"
       width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
        <bean-el:message
          key="bp.report.jdbcResourceEdit.title"
          bundle="bp.messages"
          arg0="${reportResourceForm.map.name}"
        />
      </div>
      <c:if test="${!empty reportConfigStatusKey}">
        <bean-el:message key="${reportConfigStatusKey}" bundle="bp.messages"/>
      </c:if>
      <div class="errorMessage"><html-el:errors bundle="bp.messages"/></div>

      <div class="pageSubtitle">
        <span class="left">
          <bean-el:message key="${subtitleKey}" bundle="bp.messages"/>
        </span>
        <span class="right">&nbsp;</span>
      </div>

      <div class="pageInstructions" align="left">
        <bean-el:message
          key="bp.report.resourceEdit.pageInstructions"
          bundle="bp.messages"
        />
      </div>

      <!--start main content area here-->
      <table class="labelForm"
             width="100%" border="0" cellspacing="0" cellpadding="0"
             summary="resource config info">
        <c:choose>
          <c:when test="${reportResourceForm.map.type == 'jdbc.datasource'}">
            <!-- JDBC data source -->
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.jndi"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="middle" width="34%" class="labelField">
                <html-el:text maxlength="80" size="48" property="jndi"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.pool"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="3" property="pool"/>
              </td>
            </tr>
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.user"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="24" property="user"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.password"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:password maxlength="24" property="password"/>
              </td>
            </tr>
          </c:when>

          <c:when test="${reportResourceForm.map.type == 'jdbc.driver'}">
            <!-- JDBC driver -->
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.driver"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="64" property="driver"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.url"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="64" property="url"/>
              </td>
            </tr>
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.user"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="24" property="user"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.password"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:password maxlength="24" property="password"/>
              </td>
            </tr>
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.jdbcResourceEdit.label.pool"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <html-el:text maxlength="3" property="pool"/>
              </td>
              <td valign="middle" width="16%" class="label">&nbsp;</td>
              <td valign="top" width="34%" class="labelField">&nbsp;</td>
            </tr>
          </c:when>
        </c:choose>
      </table>
      <!--end main content area here-->

      <div class="pageButtonWrap" align="right">
        <html-el:reset styleClass="inputButton" property="resetBtn">
          <bean-el:message key="button.reset" bundle="bp.messages" />
        </html-el:reset>
        &nbsp;&nbsp;
        <html-el:button styleClass="inputButton" property="cancelBtn"
                        onclick="return doCancel(this.form);">
          <bean-el:message key="button.cancel" bundle="bp.messages"/>
        </html-el:button>
        <html-el:submit styleClass="inputButton" property="submitBtn">
          <bean-el:message key="button.update" bundle="bp.messages"/>
        </html-el:submit>
      </div>
    </td>
  </tr>
</table>

</html-el:form>

<!-- =============================================================
  ** vim: set ts=2 expandtab syntax=jsp:
  -->
